#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
class Animal {
public:
    string name;
    virtual void makeSound() = 0;
};
class Tiger : public Animal {
public:
    void makeSound() override {
        cout << "Roar!" << endl;
    }
};
class Elephant : public Animal {
public:
    void makeSound() override {
        cout << "Trumpet!" << endl;
    }
};
class Fox : public Animal {
public:
    void makeSound() override {
        cout << "Yap!" << endl;
    }
};
class Panda : public Animal {
public:
    void makeSound() override {
        cout << "Squeak!" << endl;
    }
};

int main() {
    srand(static_cast<unsigned int>(time(0)));
    const int numAnimals = 10;
    Animal* animals[numAnimals];
    for (int i = 0; i < numAnimals; ++i) {
        int randomType = rand() % 4;
        switch (randomType) {
        case 0:
            animals[i] = new Tiger();
            break;
        case 1:
            animals[i] = new Elephant();
            break;
        case 2:
            animals[i] = new Fox();
            break;
        default:
            animals[i] = new Panda();
            break;
        }
    }
    for (int i = 0; i < numAnimals; ++i) {
        animals[i]->makeSound();
        delete animals[i];
    }

    return 0;
}
